package de.dhbw.horb.inf2013.vierFarbenProblem.view.java2D;

import java.awt.Color;
import java.awt.Graphics2D;

/**
 * The Class Hexagon.
 */
public class Hexagon {

	/** The x. */
	private final int[] x = new int[6];

	/** The y. */
	private final int[] y = new int[6];

	/** The number of points. */
	private final int numberOfPoints = 6;

	/** The color. */
	private Color color;

	/**
	 * Instantiates a new hexagon.
	 * 
	 * @param x
	 *            the x
	 * @param y
	 *            the y
	 */
	public Hexagon(int[] x, int[] y) {
		for (int i = 0; i < x.length; i++) {
			this.x[i] = x[i];
			this.y[i] = y[i];
		}
	}

	/**
	 * Sets the color variable.
	 * 
	 * @param color
	 *            the new color variable
	 */
	public void setColorVariable(Color color) {
		this.color = color;
	}

	/**
	 * Paint.
	 * 
	 * @param g
	 *            the g
	 */
	public void paint(Graphics2D g) {
		g.setColor(color);
		g.fillPolygon(x, y, numberOfPoints);
		g.setColor(Color.WHITE);
		g.drawPolygon(x, y, numberOfPoints);
	}

}
